/** 
 
*/
import React, { PureComponent } from 'react';
import AddBuyBackOrderC from './addBuyBackOrderC';
import { connect } from 'dva';
import 'moment/locale/zh-cn';

class ExchangePledgeC extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      portfolioId: undefined, //组合id
    };
  }

  //组合id 变更
  portfolioIdChange = (e) => {
    this.setState({
      portfolioId: e,
    });
    this.props.onChange(e); //组合id变更 抛出给父组件
  };

  render() {
    const { availableAsset, type, listId } = this.props;
    return (
      <div>
        <AddBuyBackOrderC type={type} listId={listId} portfolioIdChange={this.portfolioIdChange} money={availableAsset} onCancel={this.props.onCancel} onOk={this.props.onOk} />
      </div>
    );
  }
}
export default connect(({ exchangePledgeM, userM: user, loading }) => ({
  exchangePledgeM,
  user,
  loading,
}))(ExchangePledgeC);
